3.1.8 \(\int \frac {\csc (x)}{a+a \sin (x)} \, dx\) [8]

Optimal. Leaf size=20 \[ -\frac {\tanh ^{-1}(\cos (x))}{a}+\frac {\cos (x)}{a+a \sin (x)} \]

[Out]

-arctanh(cos(x))/a+cos(x)/(a+a*sin(x))

________________________________________________________________________________________

Rubi [A]
time = 0.03, antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.273, Rules used = {2826, 3855, 2727} \begin {gather*} \frac {\cos (x)}{a \sin (x)+a}-\frac {\tanh ^{-1}(\cos (x))}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[x]/(a + a*Sin[x]),x]

[Out]

-(ArcTanh[Cos[x]]/a) + Cos[x]/(a + a*Sin[x])

Rule 2727

Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> Simp[-Cos[c + d*x]/(d*(b + a*Sin[c + d*x])), x]
/; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2826

Int[1/(((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])), x_Symbol] :> Dist[b/(
b*c - a*d), Int[1/(a + b*Sin[e + f*x]), x], x] - Dist[d/(b*c - a*d), Int[1/(c + d*Sin[e + f*x]), x], x] /; Fre
eQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\csc (x)}{a+a \sin (x)} \, dx &=\frac {\int \csc (x) \, dx}{a}-\int \frac {1}{a+a \sin (x)} \, dx\\ &=-\frac {\tanh ^{-1}(\cos (x))}{a}+\frac {\cos (x)}{a+a \sin (x)}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(74\) vs. \(2(20)=40\).
time = 0.04, size = 74, normalized size = 3.70 \begin {gather*} -\frac {\left (\cos \left (\frac {x}{2}\right )+\sin \left (\frac {x}{2}\right )\right ) \left (\cos \left (\frac {x}{2}\right ) \left (\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right )+\left (2+\log \left (\cos \left (\frac {x}{2}\right )\right )-\log \left (\sin \left (\frac {x}{2}\right )\right )\right ) \sin \left (\frac {x}{2}\right )\right )}{a (1+\sin (x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[x]/(a + a*Sin[x]),x]

[Out]

-(((Cos[x/2] + Sin[x/2])*(Cos[x/2]*(Log[Cos[x/2]] - Log[Sin[x/2]]) + (2 + Log[Cos[x/2]] - Log[Sin[x/2]])*Sin[x
/2]))/(a*(1 + Sin[x])))

________________________________________________________________________________________

Maple [A]
time = 0.11, size = 21, normalized size = 1.05

method result size
default \(\frac {\frac {2}{\tan \left (\frac {x}{2}\right )+1}+\ln \left (\tan \left (\frac {x}{2}\right )\right )}{a}\) \(21\)
norman \(\frac {2}{a \left (\tan \left (\frac {x}{2}\right )+1\right )}+\frac {\ln \left (\tan \left (\frac {x}{2}\right )\right )}{a}\) \(24\)
risch \(\frac {2}{\left ({\mathrm e}^{i x}+i\right ) a}-\frac {\ln \left ({\mathrm e}^{i x}+1\right )}{a}+\frac {\ln \left ({\mathrm e}^{i x}-1\right )}{a}\) \(42\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(x)/(a+a*sin(x)),x,method=_RETURNVERBOSE)

[Out]

1/a*(2/(tan(1/2*x)+1)+ln(tan(1/2*x)))

________________________________________________________________________________________

Maxima [A]
time = 0.39, size = 31, normalized size = 1.55 \begin {gather*} \frac {\log \left (\frac {\sin \left (x\right )}{\cos \left (x\right ) + 1}\right )}{a} + \frac {2}{a + \frac {a \sin \left (x\right )}{\cos \left (x\right ) + 1}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+a*sin(x)),x, algorithm="maxima")

[Out]

log(sin(x)/(cos(x) + 1))/a + 2/(a + a*sin(x)/(cos(x) + 1))

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 53 vs. \(2 (20) = 40\).
time = 0.40, size = 53, normalized size = 2.65 \begin {gather*} -\frac {{\left (\cos \left (x\right ) + \sin \left (x\right ) + 1\right )} \log \left (\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - {\left (\cos \left (x\right ) + \sin \left (x\right ) + 1\right )} \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - 2 \, \cos \left (x\right ) + 2 \, \sin \left (x\right ) - 2}{2 \, {\left (a \cos \left (x\right ) + a \sin \left (x\right ) + a\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+a*sin(x)),x, algorithm="fricas")

[Out]

-1/2*((cos(x) + sin(x) + 1)*log(1/2*cos(x) + 1/2) - (cos(x) + sin(x) + 1)*log(-1/2*cos(x) + 1/2) - 2*cos(x) +
2*sin(x) - 2)/(a*cos(x) + a*sin(x) + a)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\csc {\left (x \right )}}{\sin {\left (x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+a*sin(x)),x)

[Out]

Integral(csc(x)/(sin(x) + 1), x)/a

________________________________________________________________________________________

Giac [A]
time = 0.48, size = 24, normalized size = 1.20 \begin {gather*} \frac {\log \left ({\left | \tan \left (\frac {1}{2} \, x\right ) \right |}\right )}{a} + \frac {2}{a {\left (\tan \left (\frac {1}{2} \, x\right ) + 1\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(x)/(a+a*sin(x)),x, algorithm="giac")

[Out]

log(abs(tan(1/2*x)))/a + 2/(a*(tan(1/2*x) + 1))

________________________________________________________________________________________

Mupad [B]
time = 6.42, size = 23, normalized size = 1.15 \begin {gather*} \frac {2}{a\,\left (\mathrm {tan}\left (\frac {x}{2}\right )+1\right )}+\frac {\ln \left (\mathrm {tan}\left (\frac {x}{2}\right )\right )}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(sin(x)*(a + a*sin(x))),x)

[Out]

2/(a*(tan(x/2) + 1)) + log(tan(x/2))/a

________________________________________________________________________________________